Declare Public Function RegOpenKeyExA Lib "advapi32" Alias "RegOpenKeyExA" (Byval HKEY As Long,Byval lpszSubKey As String,Byval dwreserved As Integer,Byval samDesired As Long, keyresult As Long) As Long
Declare Public Function RegQueryValueExA Lib "advapi32" Alias "RegQueryValueExA" (Byval HKEY As Long,Byval lpszValueName As String,Byval dwreserved As Integer, lpdwtype As Long, Byval lpData As String, readbytes As Long) As Long
Declare Public Function RegCloseKey Lib "advapi32" Alias "RegCloseKey" (Byval HKEY As Long) As Long
Declare Public Function GetPrivateProfileStringA Lib "kernel32" Alias "GetPrivateProfileStringA"(Byval AppName As String,Byval KName As Any, Byval Def As String, Byval RStr As String, Byval nSize As Integer, Byval FName As String) As Integer
Sub Main
Dim happkey As Long
Dim HKEY_LOCAL_MACHINE As Long
Dim KEY_READ As Long
Dim HKEY_CURRENT_USER As Long
Dim HKEY_CLASSES_ROOT As Long
Dim ValueType As Long
Dim ReturnedKeyContents As String * 255
Dim readbytes As Long
Dim ReturnString As String * 255
MaxBytes%=Len(ReturnString$)
IniFileName$ = "Win.Ini"
ReturnedKeycontents$=String$(255,Chr$(32))
HKEY_CLASSES_ROOT= &H80000000
HKEY_CURRENT_USER= &H80000001
HKEY_LOCAL_MACHINE= &H80000002
KEY_QUERY_VALUE=1
KEY_ENUMERATE_SUBKEYS=8
KEY_NOTIFY=16
KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY